package sk.xorty.flow.routers;

import org.springframework.integration.Message;
import org.springframework.integration.annotation.Router;
import org.springframework.stereotype.Component;
import sk.xorty.domain.Trade;

@Component
public class BigTradeRouter {

    @Router
    public String resolveChannel(Message<Trade> message) {
        if (message.getPayload().getQuantity() > 10_000) {
            return "channels.routers.bigTrades";
        }
        return "channels.routers.trades";
    }

}
